import Vue from 'vue'

export function getQuotedLists(opts) {
    return Vue.axios.post('/offer/listOfferInfo.do', opts);
}
export function getQuotedDetailInfo(opts) {
    return Vue.axios.post('/offerdetail/getOfferDetail.do', opts);
}


export function saveQuotedPriceTable(opts) {
    return Vue.axios.post('/offer/createListOfferDetailAndOffer.do', {
        quotedPrices: opts.priceTableInfo,
        offerId: opts.offerId,
        offerType: opts.offerType,
        fullworkId: opts.fullworkId,
        absenceId: opts.absenceId
    });
}
export function fetchTaxInfo(opts) {
    return Vue.axios.post('/offerdetail/getSupplierInTaxRate.do', {
        servicerates: opts.servicerates
    });
}
// 全勤下拉接口
export function fetchWorkTypeInfo(opts) {
    return Vue.axios.post('/expressionSupplier/findUserfulExpressionByOfferId.do', {
        offerId: opts.offerId,
        flag: opts.flag,
        offerType: opts.offerType
            // fullworkExpressionId: opts.fullworkId, // 全勤公式ID
            //  absenceExpressionId: opts.absenceId, // 缺勤公式ID
    });
}
// 缺勤下拉接口
export function fetchOtherWorkTypeInfo(opts) {
    return Vue.axios.post('/expressionSupplier/findUserabsenceExpressionByOfferId.do', {
        offerId: opts.offerId,
        flag: opts.flag,
        fullworkExpressionId: opts.fullworkId, // 全勤公式ID
        offerType: opts.offerType
            //  absenceExpressionId: opts.absenceId, // 缺勤公式ID
    });
}

export function fetchCountServiceAndTax(opts) {
    return Vue.axios.post('/expressionOffer/calculateExpensesForOffer.do', {
        quotedPrices: opts.quotedPrices,
        fullworkId: opts.fullworkId,
        offerId: opts.offerId
    });
}

export function receiveAnOrder(opts) {
    return Vue.axios.post('/offer/receiveAnOrder.do', opts);
}
